﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mvc.XForms.UI.Settings;
using System.Linq.Expressions;
using Mvc.XForms.Utilities;
using System.Collections.Specialized;
using System.Web.UI.WebControls;

namespace Mvc.XForms.UI {
	public class SortedParameters : ISortedParameters {
		public SortedParameters(NameValueCollection collection, string sortExpressionKey, string sortDirectionKey, string defaultSortExpression, SortDirection defaultSortDirection) {
			SortExpressionKey = sortExpressionKey;
			SortDirectionKey = sortDirectionKey;
			SortExpression = this.SortExpressionFromCollection(collection, defaultSortExpression);
			SortDirection = this.SortDirectionFromCollection(collection, defaultSortDirection);
		}

		public string SortExpressionKey { get; protected set; }
		public string SortDirectionKey { get; protected set; }
		public string SortExpression { get; private set; }
		public SortDirection SortDirection { get; private set; }
	}
}